const fs = require('fs')
// 用来读大文件
const rs = fs.createReadStream('./1.txt','utf-8')
// 写大文件
const ws = fs.createWriteStream('./2.txt','utf-8')
ws.write('111')
ws.end()

rs.on('data', (chunk) => {
  console.log(chunk)
})


rs.on('end', () => {
  console.log('end')
})

rs.on('error',(err) => {
  console.log(err)
})